import { createNode } from '../../utils/dom';
import { ToastContetnProps, ToastWrap } from './body';
import $style from './index.scss';

import { CSSValue } from '@material/typeing';
export { ToastContentType } from './body';
export interface ToastProps extends ToastContetnProps {
    className?: CSSValue;
}

const Toast = function (props?: ToastProps) {
    const { className, rootId = 'weapp-page-root', ...rest } = { ...props };
    return createNode({
        children: <ToastWrap {...rest}></ToastWrap>,
        rootId,
        id: 'toast',
        classNames: [$style.toast, className]
    });
};
export default Toast;
